SHELL := /bin/bash
BASEDIR = $(shell pwd)
export GO111MODULE=on
export GOPROXY=https://goproxy.cn,direct
export GOPRIVATE=*.gitlab.com
export GOSUMDB=off

all: fmt
	go build -o ${APP_NAME} main.go

fmt:
	gofmt -w .

utest:
	go mod tidy; \
	export PROJECT_ENV="unit" && go test -coverpkg=./... -coverprofile=coverage.data ./... -gcflags=-l ;
lint:
	golangci-lint run -c .golangci.yml;

build-linux:
	go mod tidy; \
	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w -s' -o ./build/cron/cron_linux ./cmd/cron/main.go ;

build-mac:
	go mod tidy; \
	CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags '-w -s' -o ./build/cron/cron_mac ./cmd/cron/main.go ;


help:
	@echo "make - compile the source code"
	@echo "make clean - remove binary file and vim swp files"

